<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Streetview Mapsicle v0.9.1 Reference</title>
    <link rel="stylesheet" type="text/css" href="http://code.google.com/css/codesite.css"></link>
    <link rel="stylesheet" type="text/css" href="../../util/docs/template/local_extensions.css"></link>
  </head>
  <body>
    <h1>Streetview Mapsicle</h1>
    <p>
An API for putting overlays on top of Street View</p>
    <p>For a description and examples of how to use this library, check out the <a href="examples.html">how-to</a>.</p>
    
      <h2><a name="Mapsicle"></a>class Mapsicle</h2>
      <p></p>
      
        <h3>Constructor</h3>
        <table summary="class Mapsicle - Constructor" width="90%">
          
          <tbody>
            <tr>
              <th>Constructor</th>
              
              <th>Description</th>
            </tr>
            
              <tr class="odd">
                <td><code>Mapsicle(<span class="type">name:string</span>, <span class="type">glatlng:GLatLng</span>, <span class="type">custom:MapsicleConfig</span>)</code></td>
                
                <td>Creates a new Street View Mapsicle: a street view panorama which you can overlay with markers.</td>
              </tr>
            
          </tbody>
        </table>
      
        <h3>Methods</h3>
        <table summary="class Mapsicle - Methods" width="90%">
          
          <tbody>
            <tr>
              <th>Methods</th>
              
                
                  <th>Return&nbsp;Value</th>
                
              
              <th>Description</th>
            </tr>
            
              <tr class="odd">
                <td><code>addLocation(<span class="type">newLocation:SVLocation</span>)</code></td>
                
                  
                    <td><code>None</code></td>
                  
                
                <td>Add a new location</td>
              </tr>
            
              <tr class="even">
                <td><code>addStaticOverlay(<span class="type">newOverlay:SVOverlay</span>)</code></td>
                
                  
                    <td><code>None</code></td>
                  
                
                <td>Add a static overlay</td>
              </tr>
            
              <tr class="odd">
                <td><code>clearCallbacks(<span class="type">event:String</span>)</code></td>
                
                  
                    <td><code>None</code></td>
                  
                
                <td>Remove all registered callbacks on a given event</td>
              </tr>
            
              <tr class="even">
                <td><code>clearLocations()</code></td>
                
                  
                    <td><code>None</code></td>
                  
                
                <td>Remove all locations</td>
              </tr>
            
              <tr class="odd">
                <td><code>clearStaticOverlays()</code></td>
                
                  
                    <td><code>None</code></td>
                  
                
                <td>Remove all the static overlays</td>
              </tr>
            
              <tr class="even">
                <td><code>endStreetView()</code></td>
                
                  
                    <td><code>None</code></td>
                  
                
                <td>Close down this instance of Mapsicle</td>
              </tr>
            
              <tr class="odd">
                <td><code>followLink(<span class="type">yaw:number</span>)</code></td>
                
                  
                    <td><code>None</code></td>
                  
                
                <td>Follow a link from the current position. This will fire the initialized event.
This works exactly the same as GStreetviewPanorama#followLink.</td>
              </tr>
            
              <tr class="even">
                <td><code>getLocations()</code></td>
                
                  
                    <td><code>Array[SVLocation]</code></td>
                  
                
                <td>Get all current locations</td>
              </tr>
            
              <tr class="odd">
                <td><code>getPosition()</code></td>
                
                  
                    <td><code>GStreetviewLocation</code></td>
                  
                
                <td>Get the current position of the Panorama</td>
              </tr>
            
              <tr class="even">
                <td><code>getPOV()</code></td>
                
                  
                    <td><code>GPov</code></td>
                  
                
                <td>Get either the current POV of the panorama, or what the POV will be initialized to.</td>
              </tr>
            
              <tr class="odd">
                <td><code>panoramaResized()</code></td>
                
                  
                    <td><code>None</code></td>
                  
                
                <td>Automatically resize the panorama to fit the container</td>
              </tr>
            
              <tr class="even">
                <td><code>panTo(<span class="type">target:GPov</span>)</code></td>
                
                  
                    <td><code>None</code></td>
                  
                
                <td>Pan the Street View panorama around to a particlar point of view.</td>
              </tr>
            
              <tr class="odd">
                <td><code>registerCallback(<span class="type">event:String</span>, <span class="type">callback:Function</span>)</code></td>
                
                  
                    <td><code>None</code></td>
                  
                
                <td>Register a callback to fire when a particular event occurs.</td>
              </tr>
            
              <tr class="even">
                <td><code>removeLocation(<span class="type">doomedLocation:SVLocation</span>)</code></td>
                
                  
                    <td><code>None</code></td>
                  
                
                <td>Remove the given location</td>
              </tr>
            
              <tr class="odd">
                <td><code>removeStaticOverlay(<span class="type">doomedOverlay:SVLocation</span>)</code></td>
                
                  
                    <td><code>None</code></td>
                  
                
                <td>Remove a static overlay</td>
              </tr>
            
              <tr class="even">
                <td><code>setLocations(<span class="type">results:Array[SVLocation]</span>)</code></td>
                
                  
                    <td><code>None</code></td>
                  
                
                <td>Add a list of locations</td>
              </tr>
            
              <tr class="odd">
                <td><code>setPanoramaSize(<span class="type">x:number</span>, <span class="type">y:number</span>)</code></td>
                
                  
                    <td><code>None</code></td>
                  
                
                <td>Set the panorama to be a particular size</td>
              </tr>
            
              <tr class="even">
                <td><code>setPosition(<span class="type">targetLatLng:GLatLng</span>, <span class="type">pov:GPov</span>, <span class="type">errorCallback:Function</span>)</code></td>
                
                  
                    <td><code>None</code></td>
                  
                
                <td>Attempt to change the position of the panorama</td>
              </tr>
            
              <tr class="odd">
                <td><code>setPOV(<span class="type">pov:GPov</span>)</code></td>
                
                  
                    <td><code>None</code></td>
                  
                
                <td>Works the same as <code>jumpTo</code>, but works instantly rather than a slow pan.</td>
              </tr>
            
          </tbody>
        </table>
      
        <h3>Events</h3>
        <table summary="class Mapsicle - Events" width="90%">
          
          <tbody>
            <tr>
              <th>Events</th>
              
                
                  <th>Arguments</th>
                
              
              <th>Description</th>
            </tr>
            
              <tr class="odd">
                <td><code>error</code></td>
                
                  
                    <td><code><span class="type">yaw:Mapsicle.SVErrorCodes</span></code></td>
                  
                
                <td></td>
              </tr>
            
              <tr class="even">
                <td><code>initialized</code></td>
                
                  
                    <td><code><span class="type">location:GStreetviewLocation</span></code></td>
                  
                
                <td></td>
              </tr>
            
              <tr class="odd">
                <td><code>mapsicle_click</code></td>
                
                  
                    <td><code><span class="type">pov:GPov</span></code></td>
                  
                
                <td></td>
              </tr>
            
              <tr class="even">
                <td><code>mapsicle_end</code></td>
                
                  
                    <td><code>None</code></td>
                  
                
                <td></td>
              </tr>
            
              <tr class="odd">
                <td><code>mapsicle_position_changed</code></td>
                
                  
                    <td><code><span class="type">location:GStreetviewLocation</span></code></td>
                  
                
                <td></td>
              </tr>
            
              <tr class="even">
                <td><code>mapsicle_pov_changed</code></td>
                
                  
                    <td><code><span class="type">mapsicle:Mapsicle</span></code></td>
                  
                
                <td></td>
              </tr>
            
              <tr class="odd">
                <td><code>mapsicle_ready</code></td>
                
                  
                    <td><code><span class="type">mapsicle:Mapsicle</span></code></td>
                  
                
                <td></td>
              </tr>
            
              <tr class="even">
                <td><code>mapsicle_resized</code></td>
                
                  
                    <td><code><span class="type">size:GScreenSize</span></code></td>
                  
                
                <td></td>
              </tr>
            
              <tr class="odd">
                <td><code>mapsicle_set_position_failed</code></td>
                
                  
                    <td><code><span class="type">errorCode:Mapsicle.SVErrorCodes</span></code></td>
                  
                
                <td></td>
              </tr>
            
              <tr class="even">
                <td><code>mapsicle_set_position_jumped</code></td>
                
                  
                    <td><code><span class="type">location:GStreetviewLocation</span></code></td>
                  
                
                <td></td>
              </tr>
            
              <tr class="odd">
                <td><code>mapsicle_set_position_launched</code></td>
                
                  
                    <td><code><span class="type">location:GStreetviewLocation</span></code></td>
                  
                
                <td></td>
              </tr>
            
              <tr class="even">
                <td><code>mapsicle_set_position_panned</code></td>
                
                  
                    <td><code><span class="type">pov:GPov</span></code></td>
                  
                
                <td></td>
              </tr>
            
              <tr class="odd">
                <td><code>mapsicle_set_position_success</code></td>
                
                  
                    <td><code><span class="type">location:GStreetviewLocation</span></code></td>
                  
                
                <td></td>
              </tr>
            
              <tr class="even">
                <td><code>pitchchanged</code></td>
                
                  
                    <td><code><span class="type">pitch:number</span></code></td>
                  
                
                <td></td>
              </tr>
            
              <tr class="odd">
                <td><code>yawchanged</code></td>
                
                  
                    <td><code><span class="type">yaw:number</span></code></td>
                  
                
                <td></td>
              </tr>
            
              <tr class="even">
                <td><code>zoomchanged</code></td>
                
                  
                    <td><code><span class="type">zoom:number</span></code></td>
                  
                
                <td></td>
              </tr>
            
          </tbody>
        </table>
      
    
      <h2><a name="MapsicleConfig"></a>class MapsicleConfig</h2>
      <p>Configuration options when initializing Mapsicle.

Do not use the constructor for this class, instead, instantiate it as an object literal.
All of the properties (and the object itself) are optional.</p>
      
        <h3>Properties</h3>
        <table summary="class MapsicleConfig - Properties" width="90%">
          
          <tbody>
            <tr>
              <th>Properties</th>
              
                
                  <th>Type</th>
                
              
              <th>Description</th>
            </tr>
            
              <tr class="odd">
                <td><code>avoidOverlaps</code></td>
                
                  
                    <td><code>boolean</code></td>
                  
                
                <td>Whether to push tracking markers away from each other so they don't cover each other up.</td>
              </tr>
            
              <tr class="even">
                <td><code>normalDistance</code></td>
                
                  
                    <td><code>number</code></td>
                  
                
                <td>At this distance (in metres), and any closer, a scaled marker will be displayed at full size</td>
              </tr>
            
          </tbody>
        </table>
      
    
      <h2><a name="SVCustomInfoWindow"></a>class SVCustomInfoWindow</h2>
      <p></p>
      
        <h3>Constructor</h3>
        <table summary="class SVCustomInfoWindow - Constructor" width="90%">
          
          <tbody>
            <tr>
              <th>Constructor</th>
              
              <th>Description</th>
            </tr>
            
              <tr class="odd">
                <td><code>SVCustomInfoWindow(<span class="type">params:SVCustomInfoWindowParams</span>)</code></td>
                
                <td>An overlay that shows user-specified content.</td>
              </tr>
            
          </tbody>
        </table>
      
    
      <h2><a name="SVCustomInfoWindowParams"></a>class SVCustomInfoWindowParams</h2>
      <p>The parameters when constructing an SVCustomInfoWindow. SVCustomInfoWindowParams are not constructed: create
one with an object literal containing all the necessary properties.</p>
      
        <h3>Properties</h3>
        <table summary="class SVCustomInfoWindowParams - Properties" width="90%">
          
          <tbody>
            <tr>
              <th>Properties</th>
              
                
                  <th>Type</th>
                
              
              <th>Description</th>
            </tr>
            
              <tr class="odd">
                <td><code>height</code></td>
                
                  
                    <td><code>number</code></td>
                  
                
                <td>The height of the info window, in pixels</td>
              </tr>
            
              <tr class="even">
                <td><code>inner</code></td>
                
                  
                    <td><code>element</code></td>
                  
                
                <td>A DOM element to display inside the info window</td>
              </tr>
            
              <tr class="odd">
                <td><code>width</code></td>
                
                  
                    <td><code>number</code></td>
                  
                
                <td>The width of the info window, in pixels</td>
              </tr>
            
          </tbody>
        </table>
      
    
      <h2><a name="SVLocation"></a>class SVLocation</h2>
      <p></p>
      
        <h3>Constructor</h3>
        <table summary="class SVLocation - Constructor" width="90%">
          
          <tbody>
            <tr>
              <th>Constructor</th>
              
              <th>Description</th>
            </tr>
            
              <tr class="odd">
                <td><code>SVLocation(<span class="type">params:SVLocationParams</span>)</code></td>
                
                <td>A location derived from a lat/lng that can be followed by markers and labels.</td>
              </tr>
            
          </tbody>
        </table>
      
        <h3>Methods</h3>
        <table summary="class SVLocation - Methods" width="90%">
          
          <tbody>
            <tr>
              <th>Methods</th>
              
                
                  <th>Return&nbsp;Value</th>
                
              
              <th>Description</th>
            </tr>
            
              <tr class="odd">
                <td><code>distance(<span class="type">position:GLatLng</span>)</code></td>
                
                  
                    <td><code>number</code></td>
                  
                
                <td>Find the distance in metres between this location and another position</td>
              </tr>
            
              <tr class="even">
                <td><code>inFOV()</code></td>
                
                  
                    <td><code>boolean</code></td>
                  
                
                <td>Is this location currently in our field of view? (Not necessarily visible, but we're facing in its direction).</td>
              </tr>
            
              <tr class="odd">
                <td><code>latlng()</code></td>
                
                  
                    <td><code>GLatLng</code></td>
                  
                
                <td></td>
              </tr>
            
              <tr class="even">
                <td><code>whereOffscreen()</code></td>
                
                  
                    <td><code>String</code></td>
                  
                
                <td>What direction, relative to the way we're facing, is the location? One of "left",
    "right", "up", "down" if the location is offscreen in that direction, "within"
    if visible, or "unknown" if called in a situation where it makes no sense
    (not registered within a Mapsicle, or no current Street View imagery)</td>
              </tr>
            
          </tbody>
        </table>
      
    
      <h2><a name="SVLocationParams"></a>class SVLocationParams</h2>
      <p>The parameters when constructing an SVLocation. SVLocationParams are not constructed: create one with an object
literal containing all the necessary properties.</p>
      
        <h3>Properties</h3>
        <table summary="class SVLocationParams - Properties" width="90%">
          
          <tbody>
            <tr>
              <th>Properties</th>
              
                
                  <th>Type</th>
                
              
              <th>Description</th>
            </tr>
            
              <tr class="odd">
                <td><code>cutoff</code></td>
                
                  
                    <td><code>number</code></td>
                  
                
                <td>(optional) Distance, in metres, beyond which markers and info windows
    are not displayed. Defaults to infinite.</td>
              </tr>
            
              <tr class="even">
                <td><code>goal</code></td>
                
                  
                    <td><code>boolean</code></td>
                  
                
                <td>(optional) Whether the location is a goal. If so markers and info windows
    will be displayed beyond the cutoff in "prominent" mode. It is possible,
    but not recommended to have more than one goal marker.</td>
              </tr>
            
              <tr class="odd">
                <td><code>info</code></td>
                
                  
                    <td><code>SVTrackingOverlay</code></td>
                  
                
                <td>(optional) An info window: SVCustomInfoWindow or SVMiniInfoBox.</td>
              </tr>
            
              <tr class="even">
                <td><code>lat</code></td>
                
                  
                    <td><code>number</code></td>
                  
                
                <td>Latitude</td>
              </tr>
            
              <tr class="odd">
                <td><code>lng</code></td>
                
                  
                    <td><code>number</code></td>
                  
                
                <td>Longitude</td>
              </tr>
            
              <tr class="even">
                <td><code>marker</code></td>
                
                  
                    <td><code>SVMarker</code></td>
                  
                
                <td>(optional)</td>
              </tr>
            
              <tr class="odd">
                <td><code>name</code></td>
                
                  
                    <td><code>String</code></td>
                  
                
                <td>The location's name</td>
              </tr>
            
          </tbody>
        </table>
      
    
      <h2><a name="SVMarker"></a>class SVMarker</h2>
      <p></p>
      
        <h3>Constructor</h3>
        <table summary="class SVMarker - Constructor" width="90%">
          
          <tbody>
            <tr>
              <th>Constructor</th>
              
              <th>Description</th>
            </tr>
            
              <tr class="odd">
                <td><code>SVMarker(<span class="type">params:SVMarkerParams</span>)</code></td>
                
                <td>An overlay that tracks a location with a simple icon.</td>
              </tr>
            
          </tbody>
        </table>
      
    
      <h2><a name="SVMarkerParams"></a>class SVMarkerParams</h2>
      <p>The parameters when constructing an SVMarker. SVMarkerParams are not constructed: create one with an object
literal containing all the necessary properties.</p>
      
        <h3>Properties</h3>
        <table summary="class SVMarkerParams - Properties" width="90%">
          
          <tbody>
            <tr>
              <th>Properties</th>
              
                
                  <th>Type</th>
                
              
              <th>Description</th>
            </tr>
            
              <tr class="odd">
                <td><code>height</code></td>
                
                  
                    <td><code>number</code></td>
                  
                
                <td>The height of the info window, in pixels</td>
              </tr>
            
              <tr class="even">
                <td><code>iconURL</code></td>
                
                  
                    <td><code>String</code></td>
                  
                
                <td>The URL of the image to use as the marker</td>
              </tr>
            
              <tr class="odd">
                <td><code>scale</code></td>
                
                  
                    <td><code>number</code></td>
                  
                
                <td>(optional) If 1 or undefined, the marker will always be the same size. If less than 1, the marker will be downscaled as it gets further away until it is the given fraction of its normal size.</td>
              </tr>
            
              <tr class="even">
                <td><code>showOffscreen</code></td>
                
                  
                    <td><code>boolean</code></td>
                  
                
                <td>(optional) For non-goal markers, whether to show their direction while offscreen.</td>
              </tr>
            
              <tr class="odd">
                <td><code>width</code></td>
                
                  
                    <td><code>number</code></td>
                  
                
                <td>The width of the info window, in pixels</td>
              </tr>
            
          </tbody>
        </table>
      
    
      <h2><a name="SVMiniInfoBox"></a>class SVMiniInfoBox</h2>
      <p></p>
      
        <h3>Constructor</h3>
        <table summary="class SVMiniInfoBox - Constructor" width="90%">
          
          <tbody>
            <tr>
              <th>Constructor</th>
              
              <th>Description</th>
            </tr>
            
              <tr class="odd">
                <td><code>SVMiniInfoBox(<span class="type">params:SVMiniInfoBoxParams</span>)</code></td>
                
                <td>An overlay that shows a box with a line of text.</td>
              </tr>
            
          </tbody>
        </table>
      
    
      <h2><a name="SVMiniInfoBoxParams"></a>class SVMiniInfoBoxParams</h2>
      <p>The parameters when constructing an SVMiniInfoBox. SVMiniInfoBoxParams are not constructed: create
one with an object literal containing all the necessary properties.</p>
      
        <h3>Properties</h3>
        <table summary="class SVMiniInfoBoxParams - Properties" width="90%">
          
          <tbody>
            <tr>
              <th>Properties</th>
              
                
                  <th>Type</th>
                
              
              <th>Description</th>
            </tr>
            
              <tr class="odd">
                <td><code>inner</code></td>
                
                  
                    <td><code>String</code></td>
                  
                
                <td>The text to display inside the info window</td>
              </tr>
            
              <tr class="even">
                <td><code>width</code></td>
                
                  
                    <td><code>number</code></td>
                  
                
                <td>The width of the marker, in pixels. Note that you cannot set the height.</td>
              </tr>
            
          </tbody>
        </table>
      
    
      <h2><a name="SVTrackingOverlay"></a>class SVTrackingOverlay</h2>
      <p>Parent class of overlays that track an SVLocation.  This class extends <code>SVOverlay</code>.</p>
      
        <h3>Methods</h3>
        <table summary="class SVTrackingOverlay - Methods" width="90%">
          
          <tbody>
            <tr>
              <th>Methods</th>
              
                
                  <th>Return&nbsp;Value</th>
                
              
              <th>Description</th>
            </tr>
            
              <tr class="odd">
                <td><code>tracking()</code></td>
                
                  
                    <td><code>SVLocation</code></td>
                  
                
                <td>Get the location being tracked by this overlay.</td>
              </tr>
            
          </tbody>
        </table>
      
    
    <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
    <script type="text/javascript">
      _uacct = "UA-964209-4";
      urchinTracker();
    </script> 
  </body>
</html>
